package com.jvyou.house.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jvyou.common.annotation.Excel;
import com.jvyou.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 合同对象 contract
 *
 * @author Jvyou
 * @date 2024-09-16
 */
public class Contract extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 合同ID
     */
    private Long id;

    /**
     * 房屋ID
     */
    @Excel(name = "房屋ID")
    private Long houseId;

    @Excel(name = "卖家ID")
    private Long buyerId;

    /**
     * 乙方
     */
    @Excel(name = "乙方")
    private String buyerName;

    /**
     * 乙方联系方式
     */
    @Excel(name = "乙方联系方式")
    private String buyerPhone;

    /**
     * 租期（月）
     */
    @Excel(name = "租期", readConverterExp = "月=")
    private Long rentalPeriod;

    /**
     * 租赁开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "租赁开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /**
     * 租赁结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "租赁结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /**
     * 总金额
     */
    @Excel(name = "总金额")
    private BigDecimal totalAmount;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private Long status;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remarks;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setHouseId(Long houseId) {
        this.houseId = houseId;
    }

    public Long getHouseId() {
        return houseId;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerPhone(String buyerPhone) {
        this.buyerPhone = buyerPhone;
    }

    public String getBuyerPhone() {
        return buyerPhone;
    }

    public void setRentalPeriod(Long rentalPeriod) {
        this.rentalPeriod = rentalPeriod;
    }

    public Long getRentalPeriod() {
        return rentalPeriod;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    public Long getStatus() {
        return status;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getRemarks() {
        return remarks;
    }

    public Long getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(Long buyerId) {
        this.buyerId = buyerId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("houseId", getHouseId())
                .append("buyerName", getBuyerName())
                .append("buyerPhone", getBuyerPhone())
                .append("rentalPeriod", getRentalPeriod())
                .append("startDate", getStartDate())
                .append("endDate", getEndDate())
                .append("totalAmount", getTotalAmount())
                .append("status", getStatus())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .append("remarks", getRemarks())
                .toString();
    }
}
